package com.seezoon.admin.modules.sys.service;

import com.seezoon.admin.framework.service.IBaseService;
import com.seezoon.dao.modules.sys.entity.SysDict;
import com.seezoon.dao.modules.sys.entity.SysFile;
import com.seezoon.framework.component.file.FileInfo;
import org.springframework.transaction.annotation.Transactional;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * @author 黎小荣
 * @since 2023/3/22
 */
public interface ISysFileService extends IBaseService<SysFile> {
    @Transactional(readOnly = true)
    List<SysFile> findByIds(@NotEmpty List<String> ids);

    FileInfo upload(@NotEmpty String originalFilename, @NotEmpty String contentType, long size,
                    @NotNull InputStream in) throws IOException;

    @Transactional(readOnly = true)
    List<FileInfo> info(@NotBlank String relativePaths, boolean includeFileName);
}
